WriteVariables

Syntax: @WriteVariables filename, variable[, variable]

The WriteVariables command write the values of the specified variables to an ASCII format text file in a format that can be read by the ReadVariables command. The file commands FOpen, FRead and FWrite are more powerful, but these more basic ReadVariables and WriteVariables commands are easier for simple file access.

By default, XpertRule will write the file to the current data sub directory. Any path specified as part of the filename will override this default path. The filename can be a string literal or a string variable.

When XpertRule runs under Windows 3.1 it uses the current application data directory as a default. This is not the case with all versions of Windows. If you are using external file references you may need to use explicit path names, or use the @XRApath command, for Windows NT, 2000 or XP.

The WriteVariables command always deletes any existing file with the same name. If there is no existing file WriteVariables will create one.

Example

@WriteVariables '\mydata\Myfile Grade', Dept, Hotel, Tempval

In this example where Grade, Dept, and Hotel are attributes and Tempval is a string variable, the text file Myfile in the sub directory \mydata might then contain information in this form:

Grade,"SenMgr"

Dept,"Accounts"

Hotel,"B"

Tempval,"Mr Smith"

The WriteVariables command can be several lines long.